#{extends 'CRUD/layout.html' /}
#{set title:messages.get('complaintTypes') /}

<script>
$(document).ready(function() {
	$("tbody tr").each(function() {
		$(this).removeClass("odd").removeClass("even");
		$(this).find("td").each(function() {
			var link = $(this).find('.hiddenLinks').text();
			$(this).click(function() {
				$(location).attr("href", link);
			});
			$(this).hover(
			  function () {
			    $(this).addClass("hover");
			  },
			  function () {
			    $(this).removeClass("hover");
			  });
		});	
	});
});
</script>

<div id="crudList" class="${type.name}">

    <h2 id="crudListTitle">&{'complaintTypes'}</h2>

    <div id="crudListSearch">
        #{crud.search /}
    </div>

    <div id="crudListTable">
        #{crud.table fields:['complaintTypeName', 'multyplier', 'syndrome'] }
	        #{crud.custom 'complaintTypeName'}
		        <span class="hiddenLinks">@{ComplaintTypes.show(object.complaintTypeId)}</span>
			    ${object.complaintTypeName}
			#{/crud.custom}
			#{crud.custom 'multyplier'}
		        <span class="hiddenLinks">@{ComplaintTypes.show(object.complaintTypeId)}</span>
			    ${object.multyplier}
			#{/crud.custom}
	        #{crud.custom 'syndrome'}
	        	<span class="hiddenLinks">@{Syndromes.show(object.syndrome.syndromeId)}</span>
			    ${object.syndrome.name}
		   #{/crud.custom}
        #{/crud.table}
    </div>

    <div id="crudListPagination">
        &{'total', models.ComplaintType.count()}
        #{pagination /}
    </div>

    <p id="crudListAdd">
        <a href="@{blank()}">&{'complaintTypes.add'}</a>
    </p>

</div>
